/**
 * 功能描述 
 */

define(function (require, exports, module) {
	var aw = require("ajaxwrapper")
	var Form = require("form");
	var store =require("store");
	var activeUser = store.get("user");
	var Dialog = require("dialog");
    var instance = {
        initComponent: function (params,widget) {
        	var form = new Form({
        	 parentNode:".J-form",
	  			 model:{
					 id:"J-form",
					 layout : "3_1",
		       		 saveaction : function(){
		       			var data = form.getData();
		       			
		       			aw.saveOrUpdate("api/checkinmeeting/confirm",data,function(data){
		       				widget.show([".J-grid"]).hide([".J-form"]);
							widget.get("subnav").hide(["return"]).show(["search","status","servicePoint","startDate"]);
							widget.get("grid").refresh();
		       			});
		       		 },
		       		 cancelaction : function(){       			 
			       			widget.show([".J-grid"]).hide([".J-form"]);
							widget.get("subnav").hide(["return"]).show(["search","status","servicePoint","startDate"]);
							widget.get("grid").refresh();
		       		 },
					items:[{
						name:"meetingDate",
						label:"会议日期",
						type:"date",
        				mode:"YYYY-MM-DD",
        				readonly: true,
					},{
						name:"screenings",
						label:"场次",
						readonly: true,
					},{
						name:"meetingRoom",
						label:"会议室",
						readonly: true,
					},{
						name:"peoCount",
						label:"参会人数",
						readonly: true,
					},{
						name:"meetPlaceType",
						label:"会议台型",
						readonly: true,
					},{
			            name: "content",
			            label: "例牌横幅",
			            "break": true,
			            readonly: true,
			        },{
			            name: "contentLED",
			            label: "前厅LED",
			            "break": true,
			            readonly: true,
			        },{
			            name: "license",
			            label: "水牌",
			            "break": true,
			            readonly: true,
			        },{
			        	name:"version",
			        	type:"hidden"
			        },{
			        	name:"pkCheckInMeeting",
			        	type:"hidden"
			        },{
			        	name:"checkInImplement",
			        	type:"hidden"
			        },{
			        	name:"operator",
			        	type:"hidden",
			        	defaultValue: activeUser.pkUser
			        },{
			        	name:"operateDate",
			        	type:"hidden",
			        	defaultValue:new Date().getTime()
			        }]
	  			 }
           });
        widget.set("form",form);
       }
    };
    module.exports = instance;
});
